package com.cykj.controller;

import com.cykj.dto.ResponseDto;
import com.cykj.service.AppointmentRecordService;
import com.cykj.vo.AddAppoimentVo;
import com.cykj.vo.BookingVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @BelongsProject: Psychology
 * @BelongsPackage: com.cykj.controller
 * @Author: 小林
 * @CreateTime: 2025-02-12 14:32
 * @Description: 咨询记录控制层
 * @Version: 1.0
 */
@RestController
@RequestMapping("/appointment")
public class AppointmentRecordController {
    @Autowired
    private AppointmentRecordService appointmentRecordService;

    /**
     * 插入咨询记录
     * @param vo
     * @return
     */
    @RequestMapping("/insertAppoiment")
    public ResponseDto insertAppoiment(@RequestBody AddAppoimentVo vo){
        try {
            return appointmentRecordService.insertAppoiment(vo);
        } catch (Exception e) {
            return ResponseDto.error("异常");
        }
    }

    /**
     * 修改评价内容
     * @param vo
     * @return
     */
    @RequestMapping("/updateContent")
    public ResponseDto updateContent(@RequestBody BookingVo vo){
        return appointmentRecordService.updateContent(vo);
    }
}

